<?php
/**
 * recomssi.func.php
 */

if(!defined('IN_SITE') || !defined('IN_ADMIN')) {
	exit('Access Denied');
}

function createssi($cateid, $limit, $template, $filedir, $special=0)
{
	global $db, $tablepre;
	$where = $special ? "AND special=$special" : '';
	$limit = $limit ? "$limit" : '0,5';
	$filedir = SITE_ROOT.$filedir;
	$data = $db->fetch_all("SELECT title, stitle, description, url, pubtime, thumbimg FROM {$tablepre}content WHERE status>0 AND cateid=$cateid $where ORDER BY status DESC, pubtime DESC LIMIT $limit");
	ob_start();
	include template($template);
	return createhtml($filedir);
}
function createztssi($limit, $template, $filedir)
{
	global $db, $tablepre;
	$limit = $limit ? "$limit" : '0,5';
	$filedir = SITE_ROOT.$filedir;
	$jcdata = $db->fetch_all("SELECT title, stitle, description, url, pubtime FROM {$tablepre}content WHERE status>0 AND special=1 ORDER BY status DESC, comments DESC LIMIT $limit");
	$zxdata = $db->fetch_all("SELECT title, stitle, description, url, pubtime FROM {$tablepre}content WHERE status>0 AND special=1 ORDER BY status DESC, pubtime DESC LIMIT $limit");
	ob_start();
	include template($template);
	return createhtml($filedir);
}
?>